1. Field of the Invention
The present invention relates generally to selecting and highlighting objects in a client browser. More specifically, the invention relates to a method, apparatus, system, and article of manufacture for the selection and highlighting of dynamically rendered 3D objects in a web application using run length encoding to compress an object selection buffer.
2. Description of the Related Art
When browsing the Internet using a client browser/web browser, images (two-dimensional [2D] and/or three-dimensional [3D]) having embedded objects are often displayed. It is often desirable for a user to select and/or highlight these embedded objects in the web browser using a cursor control device (e.g., a computer mouse). Existing browser based solutions track mouse movements by round tripping between the server and client. Other solutions install thick client applications to process the selection and highlighting. However, such round tripping or thick client applications require significant processing by both the client and server and consume resources and time to conduct. These problems may be better understood with a more detailed description of client web applications and selection/highlighting in such applications.
Web applications may often attempt to provide users with the ability to select and highlight objects in a 3D dynamically generated scene. Responsiveness is critical for selection and highlighting that provides a good user experience. As the user moves the mouse, he/she needs to see objects highlighted or distinguished. When a user clicks a cursor control device, he/she needs to select an object with little or no delay.
Traditionally, a “Zero Client” application is a hardware only appliance that runs no software at all but directly connects the user to a virtualized desktop. As used herein, a zero client application may be viewed as an application executing on a client with limited processing capabilities. In such a client computer, functionality and processing may provide a web browser application. However, the ability to execute processing or install add-ins in such a web browser may be limited (e.g., by the hardware). Accordingly, zero client applications may leverage a web browser on a client's computer to render marked-up content and to run a scripting language based application (e.g., JavaScript™) without installing browser plug-ins. This is an environment with limited functionality and performance.
Scripting languages such as JavaScript™ are interpreted languages that run slow and isolated. When more processing is needed, the scripting languages executing in the browser can leverage server side power and resources. However, server requests (i.e., from the client) also have a cost depending on the user Internet connection, distance between the client and the server, and other factors that may result in a one second (or longer) penalty for going to the server (or for performing a round trip operation).
Operations like selecting and highlighting objects in a rendered 3D scene are difficult in the browser. Traditionally, selecting an object can be done multiple ways. One way is to install a thick client application. However, thick client applications may not be possible on Zero Client computers and even if possible would require significant processing time and resources.
A second way to select and highlight objects is to utilize a selection buffer. A selection buffer is a rendering, but instead of coloring each pixel based on a lighting equation, the output is an identification (ID) of the rendered object. Selection is done by reading the value (which is a color value in a standard rendering) at an x and y location in the selection buffer. The read value is the object ID.
In the same way the server is used to render the 3D scene, it would be good if the server could provide this selection buffer to the client (e.g., for use on a client with limited processing capabilities). However, such a server-provided selection buffer creates a problem as the selection buffer needs to be processed quickly in the scripting language application as the user moves the cursor control device and clicks a cursor control device button. Many scripting language applications (e.g., JavaScript™) cannot handle the size of a raw selection buffer even when the scene size is as small as 640×480 pixels. In this regard, a raw selection buffer is too slow to transfer over the wide area network (WAN) and is too large to use with a scripting language application in a browser.
Accordingly, what is needed is a client-browser based capability to quickly and efficiently select and highlight one or more objects in a 2D or 3D image.